package model;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.List;


/**
 * The persistent class for the PRODUCT database table.
 * 
 */
@Entity
public class Product implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="PRODUCT_ID")
	private long productId;

	@Column(name="PRODUCT_DESCRIPTION")
	private String productDescription;

	@Column(name="PRODUCT_FINISH")
	private String productFinish;

	@Column(name="PRODUCT_STANDARD_PRICE")
	private BigDecimal productStandardPrice;

	//bi-directional many-to-one association to OrderLine
	@OneToMany(mappedBy="product")
	private List<OrderLine> orderLines;

	//bi-directional many-to-many association to WorkCenter
	@ManyToMany(mappedBy="products")
	private List<WorkCenter> workCenters;

	//bi-directional many-to-one association to ProductLine
	@ManyToOne
	@JoinColumn(name="PRODUCT_LINE_ID")
	private ProductLine productLine;

	//bi-directional many-to-one association to Us
	@OneToMany(mappedBy="product")
	private List<Us> uses;

	public Product() {
	}

	public long getProductId() {
		return this.productId;
	}

	public void setProductId(long productId) {
		this.productId = productId;
	}

	public String getProductDescription() {
		return this.productDescription;
	}

	public void setProductDescription(String productDescription) {
		this.productDescription = productDescription;
	}

	public String getProductFinish() {
		return this.productFinish;
	}

	public void setProductFinish(String productFinish) {
		this.productFinish = productFinish;
	}

	public BigDecimal getProductStandardPrice() {
		return this.productStandardPrice;
	}

	public void setProductStandardPrice(BigDecimal productStandardPrice) {
		this.productStandardPrice = productStandardPrice;
	}

	public List<OrderLine> getOrderLines() {
		return this.orderLines;
	}

	public void setOrderLines(List<OrderLine> orderLines) {
		this.orderLines = orderLines;
	}

	
	public OrderLine addOrderLines(OrderLine orderLines) {
		getOrderLines().add(orderLines);
		orderLines.setProduct(this);

		return orderLines;
	}

	public OrderLine removeOrderLines(OrderLine orderLines) {
		getOrderLines().remove(orderLines);
		orderLines.setProduct(null);

		return orderLines;
	}
	public List<WorkCenter> getWorkCenters() {
		return this.workCenters;
	}

	public void setWorkCenters(List<WorkCenter> workCenters) {
		this.workCenters = workCenters;
	}

	
	public ProductLine getProductLine() {
		return this.productLine;
	}

	public void setProductLine(ProductLine productLine) {
		this.productLine = productLine;
	}

	
	public List<Us> getUses() {
		return this.uses;
	}

	public void setUses(List<Us> uses) {
		this.uses = uses;
	}

	
	public Us addUses(Us uses) {
		getUses().add(uses);
		uses.setProduct(this);

		return uses;
	}

	public Us removeUses(Us uses) {
		getUses().remove(uses);
		uses.setProduct(null);

		return uses;
	}
}